<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Role extends Model
{
	protected $table = 'roles';

    public function permissions()
    {
    	return $this->belongsToMany('App\Permission','role_has_permissions','role_id','permission_id');
    }

    public function roles()
    {
    	return $this->belongsTo(self::class,'role_has_permissions');
    }
}
